package cn.tedu.net.thread;
//本类用来完成多线程编程实现方案二
public class Test2_Thread2 {
    public static void main(String[] args) {
       MyRunnable me=new MyRunnable();
       //把接口的实现对象和Thread类进行绑定  Thread有含有Runnable类型的构造方法
       Thread t=new Thread(me,"妈咪妈咪哄");
       Thread t2=new Thread(me,"玛卡巴卡");
       Thread t3=new Thread(me,"米西米西");
       t.start();
       t2.start();
       t3.start();
    }
}
class MyRunnable implements Runnable{
    public MyRunnable() {
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(i+"="+Thread.currentThread().getName());
        }
    }
}